package com.briup.recognition.service.impl;

import com.briup.recognition.bean.BaseLog;
import com.briup.recognition.bean.BaseLogExample;
import com.briup.recognition.dao.BaseFileMapper;
import com.briup.recognition.dao.BaseLogMapper;
import com.briup.recognition.service.IBaseLogService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class BaseLogServiceImpl implements IBaseLogService {

    //
    @Resource
    private BaseLogMapper baseLogMapper;


    @Override
    public List<BaseLog> query() {
        BaseLogExample example = new BaseLogExample();

        return baseLogMapper.selectByExample(example);
    }

    @Override
    public void saveOrUpdate(BaseLog baseLog) {
        if (baseLog.getId()!=null){
            baseLogMapper.updateByPrimaryKey(baseLog);
        }else {
            baseLogMapper.insert(baseLog);
        }
    }

    @Override
    public void deleteById(Long id) {
        baseLogMapper.deleteByPrimaryKey(id);
    }
}
